package com.itheima.mapper;


import com.itheima.pojo.CheckGroup;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CheckGroupMapper {
    void addItems(@Param("ids") Integer[] checkitemIds, @Param("id") Integer id);
@Insert("insert into t_checkgroup (id, code, name, helpCode, sex, remark, attention) VALUES " +
        "(null,#{code},#{name},#{helpCode},#{sex},#{remark},#{attention})")
@Options(useGeneratedKeys = true, keyProperty = "id")
    void addGroup(CheckGroup checkGroup);

@Select("select count(1) from t_setmeal_checkgroup where checkgroup_id = #{id}")
    int findCountBySetmealId(Integer id);
@Delete("delete from t_checkgroup where id = #{id}")
    int delete(Integer id);
@Select("select checkgroup_id from t_setmeal_checkgroup where setmeal_id =#{setmealId}")
    List<Integer> findCheckGroupIdsBySetmealId(Integer setmealId);

    List<CheckGroup> findPage(String queryString);

    void edit( CheckGroup checkGroup);
@Select("select * from t_checkgroup ")
    List<CheckGroup> findAll();
@Select("select * from t_checkgroup where id = #{id}")
    CheckGroup findById(Integer id);
}
